clear all
set maxvar 30000
version 14
capture log close
set more off

****************************************************************************************************
* -----   Customize the paths and options:   ----- 
****************************************************************************************************
*cd  "Data\"
global MY_IN_PATH   "C:\Users\benjamin.balsmeier\Dropbox\Research\REStat\data"
global MY_OUT_PATH  "C:\Users\benjamin.balsmeier\Dropbox\Research\REStat\data"
*global MY_TEMP_PATH "..."

global MY_OUT_FILE  ${MY_OUT_PATH}out.dta
global MY_LOG_FILE  ${MY_OUT_PATH}cr_g1.log

log using "${MY_LOG_FILE}", text replace
****************************************************************************************************
* import data
*************************************************************************************************
use ${MY_OUT_PATH}\patents2.dta, clear

****************************************** 
* GRAPH 
****************************************

xtset ts app_qtr
sort app_qtr
label var mis "Fraction of Patents in New to Firm Technolgies"
label var app_qtr "Time"
xtset ts app_qtr
local rec1a "1953q3 1953q4 1954q1 1954q2"
local rec1 "1957q3 1957q4 1958q1 1958q2" 	
local rec2 "1960q2 1960q3 1960q4 1961q1" 
local rec3 "1969q4 1970q1 1970q2 1970q3 1970q4" 	
local rec4 "1973q4 1974q1 1974q2 1974q3 1974q4 1975q1"
local rec5 "1980q1 1980q2 1980q3"
local rec6 "1981q3 1981q4 1982q1 1982q2 1982q3 1982q4"
local rec7 "1990q3 1990q4 1991q1"
local rec8 "2001q1 2001q2 2001q3 2001q4"
local rec9 "2007q4 2008q1 2008q2 2008q3 2008q4 2009q1 2009q2"

tsline mis, tline(`rec2' `rec3' `rec4' `rec5' `rec6' `rec7' `rec8' `rec9', lc(gs12) lwidth(thick)) ///
 tlabel(1960q2 1969q4 1973q4 1980q1 1990q3 2001q1 2007q4, noticks format(%tqCY) labsize(*0.9))  xtitle("") ///
 title("Innovative Search over Time")

